#include "lab5_puma.h"

lab5_puma::lab5_puma(QWidget *parent, Qt::WFlags flags)
	: QMainWindow(parent, flags)
{
	ui.setupUi(this);

	QGLFormat fmt(QGL::SampleBuffers);
    fmt.setVersion(3,3);
    //fmt.setProfile(QGLFormat::CoreProfile);//DOESN'T WORK WITH CORE PROFILE(NOTHING ON SCREEN)
    fmt.setProfile(QGLFormat::CompatibilityProfile);
	fmt.setDoubleBuffer(true);
	fmt.setDepth(false);
	fmt.setAlpha(true);
	
	fmt.setDepthBufferSize(0);
	fmt.setDoubleBuffer(true);
	glWidget = new GLWidget(fmt, this);

	ui.mainLayout->addWidget(glWidget);
	glWidget->grabKeyboard();
}

lab5_puma::~lab5_puma()
{
	ui.mainLayout->removeWidget(glWidget);
	delete glWidget;
}
